package com.artifact.mit.mypoint.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.artifact.mit.mypoint.R;
import com.artifact.mit.mypoint.service.model.PointIssuer;

public class TransferPointRightTabAdapter extends ArrayAdapter<PointIssuer> {

	public TransferPointRightTabAdapter(Context context) {
		super(context, 0);
	}
	
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = LayoutInflater.from(getContext()).inflate(
					R.layout.transfer_point_rightab_row, null);
		}
		ImageView imageLogo = (ImageView) convertView.findViewById(R.id.imageView1);
		TextView name = (TextView) convertView.findViewById(R.id.textView1);
		TextView source =  (TextView) convertView.findViewById(R.id.textView2);
		TextView exchange =  (TextView) convertView.findViewById(R.id.textView3);
		
		imageLogo.setImageResource(getItem(position).imageLogo);
		name.setText(getItem(position).name);
		source.setText(getItem(position).source);
		exchange.setText(getItem(position).exchange);
		
		return convertView;
	}
}
